home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Education / numericalmethods Folder / chap_4 / zinv.m < prev    next >
Encoding:
Text File  |  1994-06-05  |  776 b   |  53 lines  |  [MATF/MATL]

  1. function [fun,dfun,ifun,x0,m,C,Ax] = zinv
  2. % Taylor series coefficient lists for several functions.
  3. % Pm(x) = c(1) + c(2)x + c(2)x^2 + ... + c(m+1)x^m
  4. % fun  is the function, output.
  5. % dfun is the derivative, output.
  6. % ifun is the integral, output.
  7. % x0 is the point of expansion, output.
  8. % m  is the degree of the polynomial, output.
  9. % C  is the coefficient list, output.
  10. % Ax contains three asis vectors plotting, output.
  11. x0 = 0; 
  12. m = 25;
  13. a = -0.9;
  14. b = 1;
  15. ymin = 0;
  16. ymax = 10;
  17. ymin1 = -10;
  18. ymax1 = 0;
  19. ymin2 = -2.5;
  20. ymax2 = 1;
  21. Ax(1,:) = [a b ymin ymax];
  22. Ax(2,:) = [a b ymin1 ymax1];
  23. Ax(3,:) = [a b ymin2 ymax2];
  24. fun = '(1+x).^(-1)';
  25. dfun = '-(1 + x).^(-2)';
  26. ifun = 'log(1 + x)';
  27. C = [-1,
  28. 1,
  29. -1,
  30. 1,
  31. -1,
  32. 1,
  33. -1,
  34. 1,
  35. -1,
  36. 1,
  37. -1,
  38. 1,
  39. -1,
  40. 1,
  41. -1,
  42. 1,
  43. -1,
  44. 1,
  45. -1,
  46. 1,
  47. -1,
  48. 1,
  49. -1,
  50. 1,
  51. -1,
  52. 1];
  53.